home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
vbcred1a
/
ccredits.cls
next >
Wrap
Text File
|
1999-08-28
|
2KB
|
75 lines
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cCredits"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' Array of colours (For fading)
Private C(5) As Long
' Y position
Public PosY As Long
Private Sub Class_Initialize()
' Loop to end of colours array
For i = 0 To UBound(C)
' Greyscale from black to white
C(i) = RGB(i * 51, i * 51, i * 51)
Next i
End Sub
Public Sub Move(Amt As Long)
' Move the position by Amt
PosY = PosY + Amt
End Sub
Public Sub Draw(hDC As Long, SWidth As Long, SHeight As Long)
If PosY = 0 - (14 * (UBound(Strings) + 1)) Then PosY = SHeight
For i = 0 To UBound(Strings)
If (i * 14) + PosY < 0 Then
n = (i * 14) + PosY
n = -Int(n)
Select Case n
Case 1:
SetTextColor hDC, C(5)
Case 2:
SetTextColor hDC, C(4)
Case 3:
SetTextColor hDC, C(3)
Case 4:
SetTextColor hDC, C(2)
Case 5:
SetTextColor hDC, C(1)
Case Else:
SetTextColor hDC, C(0)
End Select
ElseIf ((i + 1) * 14) + PosY > SHeight Then
n = ((i + 1) * 14) + PosY - SHeight
Select Case n
Case 1:
SetTextColor hDC, C(5)
Case 2:
SetTextColor hDC, C(4)
Case 3:
SetTextColor hDC, C(3)
Case 4:
SetTextColor hDC, C(2)
Case 5:
SetTextColor hDC, C(1)
Case Else:
SetTextColor hDC, C(0)
End Select
Else
SetTextColor hDC, C(5)
End If
TextOut hDC, SWidth / 2, (i * 14) + PosY, Strings(i), Len(Strings(i))
Next i
End Sub